/*********************\
* Author:Dzlua
* QQ:505544956
* Time:2017/04/15
\**********************/
#ifndef __LUA_CONTAINER_H__
#define __LUA_CONTAINER_H__
#pragma once

#include "../Core/LuaControl.h"

namespace DuiLib {

class LuaContainer : public LuaControl
{
    SDLUA_CLASS_DECLARE(LuaContainer);

    int GetItemAt(LuaState *L);
    int GetItemIndex(LuaState *L);
    int SetItemIndex(LuaState *L);
    int GetCount(LuaState *L);
    int Add(LuaState *L);
    int AddAt(LuaState *L);
    int Remove(LuaState *L);
    bool RemoveAt(int iIndex);
    void RemoveAll();

    //void DoEvent(TEventUI& event);
    void SetVisible(bool bVisible);
    void SetInternVisible(bool bVisible);
    void SetEnabled(bool bEnabled);
    void SetMouseEnabled(bool bEnable);

    int GetInset(LuaState *L);
    int SetInset(LuaState *L);

    int GetChildPadding();
    void SetChildPadding(int iPadding);
    UINT GetChildAlign();
    void SetChildAlign(UINT iAlign);
    UINT GetChildVAlign();
    void SetChildVAlign(UINT iVAlign);
    bool IsAutoDestroy();
    void SetAutoDestroy(bool bAuto);
    bool IsDelayedDestroy();
    void SetDelayedDestroy(bool bDelayed);
    bool IsMouseChildEnabled();
    void SetMouseChildEnabled(bool bEnable);

    int FindSelectable(LuaState *L);

    int GetClientPos(LuaState *L);
    int SetPos(LuaState *L);
    int Move(LuaState *L);
    //void DoPaint(HDC hDC, const RECT& rcPaint);

    //void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);

    //void SetManager(CPaintManagerUI* pManager, CControlUI* pParent, bool bInit = true);
    //CControlUI* FindControl(FINDCONTROLPROC Proc, LPVOID pData, UINT uFlags);

    int SetSubControlText(LuaState *L);
    int SetSubControlFixedHeight(LuaState *L);
    int SetSubControlFixedWdith(LuaState *L);
    int SetSubControlUserData(LuaState *L);

    int GetSubControlText(LuaState *L);
    int GetSubControlFixedHeight(LuaState *L);
    int GetSubControlFixedWdith(LuaState *L);
    int GetSubControlUserData(LuaState *L);
    int FindSubControl(LuaState *L);

    int GetScrollPos(LuaState *L);
    int GetScrollRange(LuaState *L);
    int SetScrollPos(LuaState *L);
    
    void SetScrollStepSize(int nSize);
    int GetScrollStepSize();
    void LineUp();
    void LineDown();
    void PageUp();
    void PageDown();
    void HomeUp();
    void EndDown();
    void LineLeft();
    void LineRight();
    void PageLeft();
    void PageRight();
    void HomeLeft();
    void EndRight();
    int EnableScrollBar(LuaState *L);
    int GetVerticalScrollBar(LuaState *L);
    int GetHorizontalScrollBar(LuaState *L);

};

}

#endif //__LUA_CONTAINER_H__